// Copyright (c) 2012 PythonAnywhere LLP.
// All Rights Reserved
//
(function($) {

    function FillerElementResizeHandler($header, $element, width_ratio) {
        var self = this;

        self.resizeComponents = function(event) {
            var headerTop = $header.position().top + $header.outerHeight(true);
            var bottom_adjust = $('#id_footer').outerHeight(true) + 12;
            $element.height($(window).height() - headerTop - bottom_adjust);
            $element.width($(window).width() * width_ratio - 10);
        };
        $(window).resize(self.resizeComponents);
        self.resizeComponents();
        self.resizeComponents();
    }

    $.extend(true, window, {
        "Anywhere": {
            "FillerElementResizeHandler": FillerElementResizeHandler
        }
    });
})(jQuery);
